<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="FormulaEditDlg" widgetVar="FormulaEditDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.EditFormulaTitle}">
            <h:form id="FormulaEditForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{formulaController.selected != null}">
                        <p:outputLabel value="#{bundle.EditFormulaLabel_idcomponentesFormula1}" for="idcomponentesFormula1" />
                        <p:selectOneMenu id="idcomponentesFormula1" value="#{formulaController.selected.idcomponentesFormula1}" required="true" requiredMessage="#{bundle.EditFormulaRequiredMessage_idcomponentesFormula1}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{componentesFormulaController.itemsAvailableSelectOne}"
                                           var="idcomponentesFormula1Item"
                                           itemValue="#{idcomponentesFormula1Item}" itemLabel="#{idcomponentesFormula1Item.descripcion}"/>
                        </p:selectOneMenu>
                        <p:outputLabel value="#{bundle.EditFormulaLabel_idcomponentesFormula2}" for="idcomponentesFormula2" />
                        <p:selectOneMenu id="idcomponentesFormula2" value="#{formulaController.selected.idcomponentesFormula2}" required="true" requiredMessage="#{bundle.EditFormulaRequiredMessage_idcomponentesFormula2}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{componentesFormulaController.itemsAvailableSelectOne}"
                                           var="idcomponentesFormula2Item"
                                           itemValue="#{idcomponentesFormula2Item}" itemLabel="#{idcomponentesFormula2Item.descripcion}"/>
                        </p:selectOneMenu>
                        <p:outputLabel value="#{bundle.EditFormulaLabel_operacionIdoperacion}" for="operacionIdoperacion" />
                        <p:selectOneMenu id="operacionIdoperacion" value="#{formulaController.selected.operacionIdoperacion}" required="true" requiredMessage="#{bundle.EditFormulaRequiredMessage_operacionIdoperacion}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{operacionController.itemsAvailableSelectOne}"
                                           var="operacionIdoperacionItem"
                                           itemValue="#{operacionIdoperacionItem}" itemLabel="#{operacionIdoperacionItem.nombre}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{formulaController.update}" value="#{bundle.Save}" update="display,:FormulaListForm:datalist,:growl" oncomplete="handleSubmit(args, 'FormulaEditDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="FormulaEditDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
